home *** CD-ROM | disk | FTP | other *** search
/ ASME's Mechanical Engine…ing Toolkit 1997 December / ASME's Mechanical Engineering Toolkit 1997 December.iso / cad_gen / irit4not.txt < prev    next >
Text File  |  1994-05-14  |  5KB  |  208 lines

  1.                                 DISCLAIMER
  2.                                 ==========
  3.    I make no warranty of any kind, express or implied, including without
  4. limitation, any warranties of merchantability and/or fitness for a particular
  5. purpose.  I shall not be liable for any damages, whether direct, indirect,
  6. special or consequential arising from a failure of this program to operate in
  7. the manner desired by the user.  I shall not be liable for any damage to data
  8. or property which may be caused directly or indirectly by the use of this
  9. program.
  10.    IN NO EVENT WILL I BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING ANY LOST
  11. PROFITS,  LOST SAVINGS OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
  12. OUT OF YOUR USE OR INABILITY TO USE THE PROGRAM, OR FOR ANY CLAIM BY ANY
  13. OTHER PARTY.
  14.  
  15.    When you decide to use this package, you automatically agree for the
  16. following conditions:
  17.  
  18. 1. I hold copyrights for these sources, and my name must be left intact, even
  19.    if only part of source file is used.
  20. 2. The sources can be used to create any new software which if redistributed
  21.    will be redistributed FREE only (as IRIT executable). You dont have to
  22.    release your sources, but if you do, they must be free as well.
  23. 3. No part of the sources, will be used for commercial purposes.
  24. 4. All the sources here can be redistributed FREE only, and exactly as they
  25.    are provided to you - the exact same files. You may alter the archive
  26.    program if you prefer (i.e. to zoo format for example), but thats it!
  27. 5. Although stated in 4, you may charge for the distribution reasonable amount
  28.    of money (not more that $10).
  29.  
  30.   I decided to release these sources, mainly for educational purposes. Many
  31. peoples point out, they can learn from the sources, so here is your chance.
  32.   I certainly would like to see this set of programs continue to expand
  33. in two main direction:
  34. 1. Improving and/or fixing problems/bugs.
  35. 2. Porting these set of program to different environments.
  36.  
  37. Gershon Elber
  38.  
  39. Email:  gershon@cs.technion.ac.il
  40.  
  41. mail:   Computer Science Department
  42.     Technion, Israel Institute of Technology
  43.     Haifa 32000
  44.     Israel
  45.  
  46.  
  47. -----------------------------
  48.  
  49. The following is the file: coding.std
  50.  
  51.  
  52. These are the coding standards I am using. If you make some changes to the
  53. code, please attempt to follow these rules.
  54.  
  55. Gershon Elber
  56.  
  57. gershon@cs.technion.ac.il
  58.  
  59. ------------------------------------------------------------------------------
  60.  
  61.  
  62. GENERAL
  63. -------
  64.  
  65.     Code should not exceed column 80. If the code is going to "look"
  66.     better with more that 80 columns it is allowed but should be restricted
  67.     as possible.
  68.  
  69. NESTING
  70. -------
  71.     Nesting of all expressions is by 4 spaces. Tabs used are 8 spaces.
  72.  
  73. COMMENTS
  74. --------
  75.  
  76.     Function comments will have the following form:
  77.  
  78. SPACES
  79. ------
  80.     No spaces are allowed after '(' and before ')' in a function call
  81.     or math expression. However, spaces are allowed between arguments after
  82.     the comma or between operations:
  83.  
  84.     sin(x);
  85.     function1(x, y, z);
  86.     x + 5 * sin(y);
  87.  
  88. /*****************************************************************************
  89. * Comment body.                                     *
  90. *****************************************************************************/
  91.  
  92.     Internal comments will be aligned to the right to column 80 if the
  93.     are commenting expression in the same line:
  94.  
  95.     i %= 2;                               /* Is i even? */
  96.  
  97.     Comments that explains the following block, will be left aligned as
  98.     the block. The comment does not need to be right aligned to column 80 as
  99.     well:
  100.  
  101.     /* This is a comment for the next line. */
  102.     i %= 2;
  103.  
  104. BLOCKS
  105. ------
  106.     Blocks starts with '{' and ends with '}'. If the block is beginning
  107.     of procedure then it will start with '{' at column 1 and end at column
  108.     1 with '}'. Otherwise it will start with some expression as for/if/while
  109.     etc. in the nesting form:
  110.     expression {
  111.     .
  112.     .
  113.     .
  114.     }
  115.  
  116. FOR
  117. ---
  118.     for (x = 0; x < 10; x++)
  119.  
  120.     or
  121.     for (x = 0, i = 1;
  122.          x < 5;
  123.          x++, i--)
  124.  
  125.     The body of the for loop can never be in the same line where the ')'
  126.     is. The ')' will be followed by '{' and the body will start in the next
  127.     line nested 4 space deapper:
  128.  
  129.     for (....)
  130.         x = sin(j);
  131.     or
  132.     for (....) {
  133.         x = y / j;
  134.         y = j + 2;
  135.     }
  136.  
  137. WHILE
  138. -----
  139.     while (x > 0)
  140.         x--;                    /* Use x = 0 stupid! */
  141.     or
  142.     while (x > 0 && y > 0) {
  143.         x -= 4;
  144.         y -= 4;
  145.     }
  146.     or
  147.     while (x > 0 &&
  148.            x < 5)
  149.         x /= 2;
  150.  
  151.  
  152. IF
  153. --
  154.  
  155.     if (x > 0)
  156.         x = -x;
  157.     or
  158.     if (x > 0 && y > 0) {
  159.         x = -x;
  160.         y = -y;
  161.     }
  162.     or
  163.     if (x > 0)
  164.         x = -x;
  165.     else
  166.         x /= 2;
  167.     or
  168.     if (x > 0)
  169.         x = -x;
  170.     else if (x < -100)
  171.         x /= 20;
  172.     else
  173.         x /= 2;
  174.  
  175.  
  176.     Note that if the if expression has else part both bodies will be
  177.     aligned 4 space deep (The body of the if part can not be in same line
  178.     as the if and must be aligned with the else body).
  179.  
  180.  
  181. SWITCH
  182. ------
  183.  
  184.     switch (i) {
  185.         case 1:
  186.         printf("1");
  187.         break;
  188.         case 2:
  189.         printf("2");
  190.         break;
  191.         case 3:
  192.         printf("3");
  193.         break;
  194.         default:
  195.         printf("Too big");
  196.         break;
  197.     }
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.